﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/static/";
%>
<!DOCTYPE html>
<%--开票申请--%>
<html lang="en">
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta charset="utf-8" />
	<title>开票申请</title>
	<meta name="description" content="" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

	<link rel="stylesheet" href="static/ace/css/bootstrap.css" />
	<link rel="stylesheet" href="static/ace/css/font-awesome.css" />

	<!-- text fonts -->
	<link rel="stylesheet" href="static/ace/css/ace-fonts.css" />
	<!-- ace styles -->
	<link rel="stylesheet" href="static/ace/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />

	<link rel="stylesheet" type="text/css"
		  href="plugins/websocketInstantMsg/ext4/resources/css/ext-all.css" />

	<script type="text/javascript" src="plugins/websocketInstantMsg/ext4/ext-all-debug.js"></script>
	<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
</head>
<body class="no-skin">

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container" style="float:right">
	<div id="left" style="width:100%;"></div>
	<%--<div style="width:50%;">--%>
		<div id="rightTop" style="width: 100%;height: 50%"></div>
		<div id="rightBottom" style="width: 100%;height: 50%"></div>
	<%--</div>--%>
</div>

<%--
<script type="text/javascript" src="<%=path%>/static/js/settlement/check_income_index.js" />--%>

<script type="text/javascript">
	Ext.onReady(function () {
		var store = Ext.create('Ext.data.Store', {
			fields: ["BILL_CODE", "LADING_BILL_CODE", "SETTLEMENT_UNIT", "COST_NAME",
				"TAX_PRICE", "CONTAINER_NUM","EQUIVALENT_RMB", "CURRENCY",
				"EXCHANGE_RATE", "TRADE_TYPE_ID"],
			pageSize: 1,  //页容量5条数据
			//是否在服务端排序 （true的话，在客户端就不能排序）
			remoteSort: false,
			remoteFilter: true,
			proxy: {
				type: 'ajax',
				url: '/incomeAcct/listUndoList',
				reader: {
					//这里的reader为数据存储组织的地方，
					// 下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
					type: 'json', //返回数据类型为json格式
					root: 'data.list',  //数据
					totalProperty: 'data.total' //数据总条数
				}
			},
			/*sorters: [{
				//排序字段。
				property: 'ordeId',
				//排序类型，默认为 ASC
				direction: 'desc'
			}],*/
			autoLoad: true  //即时加载数据
		});

		var leftGrid = Ext.create('Ext.grid.Panel', {
			renderTo: "left",
			store: store,
			width: "50%",
			height: document.documentElement.clientHeight,
			//width: 800,
			stripeRows:true,
			columnLines: true,
			selModel:Ext.create('Ext.selection.CheckboxModel',{
				mode:"single", allowDeselect: true, showHeaderCheckbox:true}),
			columns: [
				{text: '托单编号', dataIndex: 'BILL_CODE', align: 'left',
					maxWidth: 100 ,locked: true},
				{text: '提单号', dataIndex: 'LADING_BILL_CODE', maxWidth: 200 ,locked:true},
				{text: '结算单位', dataIndex: 'SETTLEMENT_UNIT', align: 'left', minWidth: 80},
				{text: '费用名称', dataIndex: 'COST_NAME', maxWidth: 80, align: 'left'},
				{text: '单价', dataIndex: 'TAX_PRICE', maxWidth: 80},
				{text: '箱量', dataIndex: 'CONTAINER_NUM', maxWidth: 80},
				{text: '总金额', dataIndex: 'EQUIVALENT_RMB', maxWidth: 80},
				{text: '币种', dataIndex: 'CURRENCY', maxWidth: 80},
				{text: '汇率', dataIndex: 'EXCHANGE_RATE', maxWidth: 80},
				/*{text: '箱型', dataIndex: 'appointEstimateShipTime', maxWidth: 80},
				{text: '箱主', dataIndex: 'appointShipRoute', maxWidth: 80},
				{text: 'ETD', dataIndex: 'bookingShippingRoutes', maxWidth: 80},
				{text: '江船名', dataIndex: 'bookingSeagoingVessels', maxWidth: 80},
				{text: '江船航次', dataIndex: 'estimatePutBoxTime', maxWidth: 80},
				{text: '海船名', dataIndex: 'tradeTypeId', maxWidth: 80},
				{text: '海船航次', dataIndex: 'createTime', maxWidth: 80},
				{text: '业务员', dataIndex: '', maxWidth: 80},
				{text: '录入人', dataIndex: 'forwarderCustomerService', maxWidth: 80},
				{text: '录入时间', dataIndex: 'transportClause', maxWidth: 80},
				{text: '备注', dataIndex: 'customsNumber', maxWidth: 80},*/
				{text: '贸易方式', dataIndex: 'TRADE_TYPE_ID', maxWidth: 80}
			],
			bbar: [{
				xtype: 'pagingtoolbar',
				store: store,
				displayMsg: '显示 {0} - {1} 条，共计 {2} 条',
				emptyMsg: "没有数据",
				beforePageText: "当前页",
				afterPageText: "共{0}页",
				displayInfo: true
			}],
			listeners: {
				'itemclick': function (view, record, item, index, e) {
					//Ext.MessageBox.alert("标题", record.data.cataId);
				}
			},
			tbar: [
				{text: '新增', icon:'', handler: showAlert}, "-",
				{text: '编辑', iconCls: 'a_edit2', handler: showAlert}, "-",
				{text: '停用/启用', iconCls: 'a_lock'}, "-",
				"->", {iconCls: "a_search", text: "搜索", handler: showAlert}],
		});

		var storeRT = Ext.create('Ext.data.Store', {
			fields: ["checkId,checkerId,checkerName"],
			pageSize: 10,  //页容量5条数据
			//是否在服务端排序 （true的话，在客户端就不能排序）
			remoteSort: false,
			remoteFilter: true,
			proxy: {
				type: 'ajax',
				url: '/incomeAcct/getCheckList',
				reader: {
					//这里的reader为数据存储组织的地方，
					// 下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
					type: 'json', //返回数据类型为json格式
					root: 'data.list',  //数据
					totalProperty: 'data.total' //数据总条数
				}
			},
			autoLoad: true  //即时加载数据
		});
		var rightGrid = Ext.create('Ext.grid.Panel', {
			renderTo: "rightTop",
			store: storeRT,
			height: 500,
			//height: document.documentElement.clientHeight,
			width: "50%",
			stripeRows:true,
			columnLines: true,
			selModel:Ext.create('Ext.selection.CheckboxModel',{
				mode:"single", allowDeselect: true, showHeaderCheckbox:true}),
			columns: [
				{text: '对账单号', dataIndex: 'checkId', align: 'left',
					maxWidth: 100 ,locked: true},
				{text: '对账单位', dataIndex: '', maxWidth: 200 ,locked:true},
				{text: '对账人员', dataIndex: 'checkerName', align: 'left', minWidth: 80},
				{text: '对账日期', dataIndex: '', maxWidth: 80, align: 'left'},
				{text: '对账金额', dataIndex: '', maxWidth: 80},
				{text: '发票申请单号', dataIndex: '', maxWidth: 80},
				{text: '委托人', dataIndex: '', maxWidth: 80}
			],
			bbar: [{
				xtype: 'pagingtoolbar',
				store: store,
				displayMsg: '显示 {0} - {1} 条，共计 {2} 条',
				emptyMsg: "没有数据",
				beforePageText: "当前页",
				afterPageText: "共{0}页",
				displayInfo: true
			}],
			listeners: {
				'itemclick': function (view, record, item, index, e) {
					//Ext.MessageBox.alert("标题", record.data.cataId);
				}
			},
			tbar: [
				{text: '新增1', icon:'', handler: showAlert}, "-",
				{text: '编辑1', iconCls: 'a_edit2', handler: showAlert}, "-",
				"->", {iconCls: "a_search", text: "搜索", handler: showAlert}
			],
		});
		var rightBottomGrid = Ext.create('Ext.grid.Panel', {
			renderTo: "rightBottom",
			/*store: store,*/
			height: "50%",
			//height: document.documentElement.clientHeight,
			width: "50%",
			stripeRows:true,
			columnLines: true,
			selModel:Ext.create('Ext.selection.CheckboxModel',{
				mode:"single", allowDeselect: true, showHeaderCheckbox:true}),
			columns: [
				{text: '托单编号', dataIndex: '', align: 'left',
					maxWidth: 100 ,locked: true},
				{text: '提单号', dataIndex: '', maxWidth: 200 ,locked:true},
				{text: '海船装区', dataIndex: '', align: 'left', minWidth: 80},
				{text: '订舱状态', dataIndex: '', maxWidth: 80, align: 'left'},
				{text: 'msc提单号', dataIndex: '', maxWidth: 80},
				{text: '托运人', dataIndex: '', maxWidth: 80},
				{text: '订舱人员', dataIndex: '', maxWidth: 80},
				{text: '箱主', dataIndex: '', maxWidth: 80},
				{text: '箱型箱量', dataIndex: '', maxWidth: 80},
				{text: '指定预计海船期', dataIndex: '', maxWidth: 80}
			],
			bbar: [{
				xtype: 'pagingtoolbar',
				store: store,
				displayMsg: '显示 {0} - {1} 条，共计 {2} 条',
				emptyMsg: "没有数据",
				beforePageText: "当前页",
				afterPageText: "共{0}页",
				displayInfo: true
			}],
			listeners: {
				'itemclick': function (view, record, item, index, e) {
					//Ext.MessageBox.alert("标题", record.data.cataId);
				}
			},
			tbar: [
				{text: '新增', icon:'', handler: showAlert}, "-",
				{text: '编辑', iconCls: 'a_edit2', handler: showAlert}, "-",
				"->", {iconCls: "a_search", text: "搜索", handler: showAlert}
			]
		});

		function showAlert() {
			//var selectedData = grid.getSelectionModel().getSelection()[0].data;
			store.load({ params: { abcd: 'test',test:666} });
		}

		function convert(val) {
			return Ext.util.Format.date(new Date(val), 'Y-m-d');
		}
	});
</script>
</body>
</html>